<div class="ship_address" >
    <?php
    if($sf_user->isAuthenticated()):
        $profile = $sf_user->getDmUser()->getProfile();
        ?>
    <input type="hidden" id="error_check" value="<?php if($form->hasErrors())echo 1;else echo 0?>"/>
    <div id="shipping_address_edit_form" style="<?php if(!$form->hasErrors())echo 'display: none';?>">
            <?php
            echo $form->open();
            echo $form->renderGlobalErrors();
            ?>
        <div class="fieldset">
            <h2 class="legend">Shipping Address</h2>
            <ul class="form-list">
                <li class="fields">
                    <label for="street_1" class="required">Street Address</label>
                    <div class="input-box leftfield">
                            <?php
                            echo $form['shipping_address1']->renderError();
                            echo $form['shipping_address1']->render(array('class'=>'input-text full required-entry'))?><em>*</em>
                    </div>
                </li>
                <li class="fields address_change">
                    <div class="field leftfield field_Separator">
                        <label for="city" class="required">City</label>
                        <div class="input-box leftfield">
                                <?php
                                echo $form['shipping_city']->renderError();
                                echo $form['shipping_city']->render(array('class'=>'input-text small required-entry'))?><em>*</em>
                        </div>
                    </div>
                    <div class="field leftfield field_Separator">
                        <label id="" for="zip" class="required">Zip/Postal Code</label>
                        <div class="input-box leftfield">
                                <?php
                                echo $form['shipping_post_code']->renderError();
                                echo $form['shipping_post_code']->render(array('class'=>'input-text small required-entry'))?><em>*</em>

                        </div>
                    </div>
                    <div class="field leftfield field_Separator">
                        <label for="country" class="required">Country</label>
                        <div class="input-box leftfield">
                                <?php
                                echo $form['shipping_country']->renderError();
                                echo $form['shipping_country']->render(array('class'=>'input-text small required-entry'))?><em>*</em>
                        </div>
                    </div>
                </li>
                <li class="fields">
                    <label for="street_1" class="required">Contact Person at Delivary Address</label>
                    <div class="input-box leftfield">
                            <?php
                            echo $form['contact_person']->renderError();
                            echo $form['contact_person']->render(array('class'=>'input-text full required-entry'))?>
                    </div>
                </li>
                <li class="fields">
                    <label for="street_1" class="required">Cell no. at Delivary Address</label>
                    <div class="input-box leftfield">
                            <?php
                            echo $form['contact_phone']->renderError();
                            echo $form['contact_phone']->render(array('class'=>'input-text full required-entry'))?>
                    </div>
                </li>
                <li class="fields">
                    <label for="street_1" class="required">Delivary Date & Time</label>
                    <div class="input-box leftfield">
                            <?php
                            echo $form['delivery_time']->renderError();
                            echo $form['delivery_time']->render(array('class'=>'input-text half required-entry'))?>
                    </div>
                </li>
            </ul>
        </div>
        <div class="buttons-set">
            <p class="required">* Required Fields</p>
            <button type="submit" title="Save Address" class="button"><span><span>Save Address</span></span></button>
        </div>
            <?php
            echo $form->renderHiddenFields();
            echo $form->close();
            ?>
    </div>
    <div class="shipping_to">
        <div id="ship_add_show" style="<?php if($form->hasErrors())echo 'display: none';?>">
            <h3 class="title">Shipping to:</h3>
            <address class="_address" >
                <div class="profile_name">    <?php echo $profile->first_name?> <?php echo " ".$profile->last_name?></div>
                    <?php echo $profile->shipping_address1.', '.$profile->shipping_address2?>
                <br/>
                    <?php echo $profile->shipping_city?>
                <br/>
                    <?php echo $profile->shipping_post_code?>
                <br/>
                    <?php echo $profile->shipping_country?>

            </address>
        </div>
        <div id="edit_shipping_address" style="padding-left: 10px;">
            <button class="button edit_shipping_address_button" title="Continue Shopping" type="button btn-update" id="">
                <span><span>New Address</span></span>
            </button>
                <?php
    if($sf_user->isAuthenticated()) {
        echo _link('+/customarOrder/addCustomerOrder')->set('.button')->text('Place Order');
    }

    ?>
        </div>
    </div>


    <?php endif;?>
    <br/>
    <!--   <b>Shipping method</b>
       <form method="post" action="<?php echo _link('main/shippingMethod')->getHref()?>" name="shipping_method">
           <table cellspacing="0" cellpadding="0" id="shipping_methods" width="100%">
               <tr>
                   <th ></th>
                   <th >Name</th>
                   <th >Price</th>
               </tr>
    <?php
    $shipping_value = 0;
    foreach($shippingmethods as $key => $shippingmethod):
        if($selectedMethodId == $shippingmethod->id)
            $shipping_value = ($shippingmethod->cost+$shippingmethod->handling_cost);
        ?>
               <tr class="row-shade">
                   <td><input type="radio" <?php echo (!$selectedMethodId && $key == 0)?'checked':($selectedMethodId == $shippingmethod->id)?'checked':''?> value="<?php echo $shippingmethod->id?>" id="" name="shipping_method"></td>
                   <td><label for=""><?php echo $shippingmethod?></label></td>
                   <td><label for=""><span class="price calculated">BDT: <?php echo ($shippingmethod->cost+$shippingmethod->handling_cost)?></span></label></td>
               </tr>
    <?php endforeach;?>
           </table>

           <div class="shipping_total">
               <strong>Sub Total: </strong><span class="price calculated">BDT: <?php echo ($shopping_cart->getTotal()+$shipping_value)?></span>
           </div>
           <div class="shipping_button">
    <?php if($updateFlag):?>
               <button class="button btn-continue" onclick="window.location = '<?php echo _link('main/addToCart')->getHref();?>';return false;" title="Update Shopping Cart" type="button btn-update" ><span><span>Edit Shopping Cart</span></span></button>
               <button onClick="$(this).parents('form').attr('action',this.id).submit();return false;" class="button btn-update" title="Continue Shopping" type="button btn-update" id="<?php echo _link('main/payment')->getHref()?>"><span><span>Continue Checkout</span></span></button>
    <?php else:?>
               <button class="button btn-update" onclick="$(this).parents('form').attr('action',this.id).submit()" title="Update Shopping Cart" type="submit" id="<?php echo _link('main/shippingMethod')->getHref()?>"><span><span>Update Shopping Cart</span></span></button>
    <?php endif;?>
           </div>
       </form>-->
</div>
<div style="clear: both;"></div>

